.class public Lcom/opongo/blogapp/api/BlogAPI;
.super Landroid/app/Activity;
.source "BlogAPI.java"


# static fields
#the value of this static final field might be set in the static constructor
.field public static final DEBUG:Z = false

.field public static final PREFS_NAME:Ljava/lang/String; = "BlogApp"

.field protected static final TAG:Ljava/lang/String;

.field protected static httpConnect:Lcom/opongo/blogapp/api/HTTPConnect;


# instance fields
.field private context:Landroid/content/Context;

.field protected editor:Landroid/content/SharedPreferences$Editor;

.field protected settings:Landroid/content/SharedPreferences;


# direct methods
.method static constructor <clinit>()V
    .locals 1

    .prologue
    .line 25
    sget-boolean v0, Lcom/opongo/blogapp/AbaSettings;->DEBUG:Z

    sput-boolean v0, Lcom/opongo/blogapp/api/BlogAPI;->DEBUG:Z

    .line 26
    const-class v0, Lcom/opongo/blogapp/api/BlogAPI;

    invoke-virtual {v0}, Ljava/lang/Class;->getSimpleName()Ljava/lang/String;

    move-result-object v0

    sput-object v0, Lcom/opongo/blogapp/api/BlogAPI;->TAG:Ljava/lang/String;

    .line 22
    return-void
.end method

.method public constructor <init>(Landroid/content/Context;)V
    .locals 3
    .parameter "c"

    .prologue
    .line 34
    invoke-direct {p0}, Landroid/app/Activity;-><init>()V

    .line 36
    iput-object p1, p0, Lcom/opongo/blogapp/api/BlogAPI;->context:Landroid/content/Context;

    .line 37
    iget-object v0, p0, Lcom/opongo/blogapp/api/BlogAPI;->context:Landroid/content/Context;

    const-string v1, "BlogApp"

    const/4 v2, 0x0

    invoke-virtual {v0, v1, v2}, Landroid/content/Context;->getSharedPreferences(Ljava/lang/String;I)Landroid/content/SharedPreferences;

    move-result-object v0

    iput-object v0, p0, Lcom/opongo/blogapp/api/BlogAPI;->settings:Landroid/content/SharedPreferences;

    .line 38
    iget-object v0, p0, Lcom/opongo/blogapp/api/BlogAPI;->settings:Landroid/content/SharedPreferences;

    invoke-interface {v0}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;

    move-result-object v0

    iput-object v0, p0, Lcom/opongo/blogapp/api/BlogAPI;->editor:Landroid/content/SharedPreferences$Editor;

    .line 39
    new-instance v0, Lcom/opongo/blogapp/api/HTTPConnect;

    invoke-direct {v0}, Lcom/opongo/blogapp/api/HTTPConnect;-><init>()V

    sput-object v0, Lcom/opongo/blogapp/api/BlogAPI;->httpConnect:Lcom/opongo/blogapp/api/HTTPConnect;

    .line 40
    return-void
.end method


# virtual methods
.method public addComments(ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;I)Lorg/json/JSONObject;
    .locals 6
    .parameter "post_id"
    .parameter "comment"
    .parameter "user_name"
    .parameter "user_email"
    .parameter "user_password"
    .parameter "comment_parent"

    .prologue
    const/4 v5, 0x0

    .line 227
    new-instance v0, Ljava/util/ArrayList;

    const/4 v2, 0x2

    invoke-direct {v0, v2}, Ljava/util/ArrayList;-><init>(I)V

    .line 228
    .local v0, nameValuePairs:Ljava/util/List;,"Ljava/util/List<Lorg/apache/http/NameValuePair;>;"
    new-instance v2, Lorg/apache/http/message/BasicNameValuePair;

    const-string v3, "do"

    const-string v4, "addComment"

    invoke-direct {v2, v3, v4}, Lorg/apache/http/message/BasicNameValuePair;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    invoke-interface {v0, v2}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 229
    new-instance v2, Lorg/apache/http/message/BasicNameValuePair;

    const-string v3, "comment_post_ID"

    .line 230
    invoke-static {p1}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v4

    invoke-direct {v2, v3, v4}, Lorg/apache/http/message/BasicNameValuePair;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    .line 229
    invoke-interface {v0, v2}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 232
    new-instance v2, Lorg/apache/http/message/BasicNameValuePair;

    const-string v3, "comment"

    invoke-direct {v2, v3, p2}, Lorg/apache/http/message/BasicNameValuePair;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    invoke-interface {v0, v2}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 233
    new-instance v2, Lorg/apache/http/message/BasicNameValuePair;

    const-string v3, "user_name"

    invoke-direct {v2, v3, p3}, Lorg/apache/http/message/BasicNameValuePair;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    invoke-interface {v0, v2}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 234
    new-instance v2, Lorg/apache/http/message/BasicNameValuePair;

    const-string v3, "user_email"

    invoke-direct {v2, v3, p4}, Lorg/apache/http/message/BasicNameValuePair;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    invoke-interface {v0, v2}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 235
    new-instance v2, Lorg/apache/http/message/BasicNameValuePair;

    const-string v3, "user_password"

    .line 236
    invoke-direct {v2, v3, p5}, Lorg/apache/http/message/BasicNameValuePair;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    .line 235
    invoke-interface {v0, v2}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 237
    new-instance v2, Lorg/apache/http/message/BasicNameValuePair;

    const-string v3, "registerforcomment"

    .line 238
    invoke-static {v5}, Ljava/lang/String;->valueOf(Z)Ljava/lang/String;

    move-result-object v4

    invoke-direct {v2, v3, v4}, Lorg/apache/http/message/BasicNameValuePair;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    .line 237
    invoke-interface {v0, v2}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 240
    new-instance v2, Lorg/apache/http/message/BasicNameValuePair;

    const-string v3, "comment_parent"

    .line 241
    invoke-static {p6}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v4

    invoke-direct {v2, v3, v4}, Lorg/apache/http/message/BasicNameValuePair;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    .line 240
    invoke-interface {v0, v2}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 243
    sget-object v2, Lcom/opongo/blogapp/api/BlogAPI;->httpConnect:Lcom/opongo/blogapp/api/HTTPConnect;

    .line 244
    iget-object v3, p0, Lcom/opongo/blogapp/api/BlogAPI;->context:Landroid/content/Context;

    const/4 v4, 0x0

    .line 243
    invoke-virtual {v2, v0, v3, v5, v4}, Lcom/opongo/blogapp/api/HTTPConnect;->getJSONObjectWithPost(Ljava/util/List;Landroid/content/Context;Z[Landroid/graphics/Bitmap;)Lorg/json/JSONObject;

    move-result-object v1

    .line 246
    .local v1, result:Lorg/json/JSONObject;
    return-object v1
.end method

.method public getCategories()Lorg/json/JSONObject;
    .locals 6

    .prologue
    .line 272
    new-instance v0, Ljava/util/ArrayList;

    const/4 v2, 0x2

    invoke-direct {v0, v2}, Ljava/util/ArrayList;-><init>(I)V

    .line 273
    .local v0, nameValuePairs:Ljava/util/List;,"Ljava/util/List<Lorg/apache/http/NameValuePair;>;"
    new-instance v2, Lorg/apache/http/message/BasicNameValuePair;

    const-string v3, "do"

    const-string v4, "getCategories"

    invoke-direct {v2, v3, v4}, Lorg/apache/http/message/BasicNameValuePair;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    invoke-interface {v0, v2}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 275
    sget-object v2, Lcom/opongo/blogapp/api/BlogAPI;->httpConnect:Lcom/opongo/blogapp/api/HTTPConnect;

    .line 276
    iget-object v3, p0, Lcom/opongo/blogapp/api/BlogAPI;->context:Landroid/content/Context;

    const/4 v4, 0x0

    const/4 v5, 0x0

    .line 275
    invoke-virtual {v2, v0, v3, v4, v5}, Lcom/opongo/blogapp/api/HTTPConnect;->getJSONObjectWithPost(Ljava/util/List;Landroid/content/Context;Z[Landroid/graphics/Bitmap;)Lorg/json/JSONObject;

    move-result-object v1

    .line 278
    .local v1, result:Lorg/json/JSONObject;
    if-nez v1, :cond_0

    .line 279
    sget-boolean v2, Lcom/opongo/blogapp/api/BlogAPI;->DEBUG:Z

    if-eqz v2, :cond_0

    .line 280
    sget-object v2, Lcom/opongo/blogapp/api/BlogAPI;->TAG:Ljava/lang/String;

    const-string v3, "Received a null object"

    invoke-static {v2, v3}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I

    .line 283
    :cond_0
    return-object v1
.end method

.method public getComments(I)Lorg/json/JSONObject;
    .locals 6
    .parameter "post_id"

    .prologue
    .line 197
    new-instance v0, Ljava/util/ArrayList;

    const/4 v2, 0x2

    invoke-direct {v0, v2}, Ljava/util/ArrayList;-><init>(I)V

    .line 198
    .local v0, nameValuePairs:Ljava/util/List;,"Ljava/util/List<Lorg/apache/http/NameValuePair;>;"
    new-instance v2, Lorg/apache/http/message/BasicNameValuePair;

    const-string v3, "do"

    const-string v4, "getComments"

    invoke-direct {v2, v3, v4}, Lorg/apache/http/message/BasicNameValuePair;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    invoke-interface {v0, v2}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 199
    new-instance v2, Lorg/apache/http/message/BasicNameValuePair;

    const-string v3, "comment_post_ID"

    .line 200
    invoke-static {p1}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v4

    invoke-direct {v2, v3, v4}, Lorg/apache/http/message/BasicNameValuePair;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    .line 199
    invoke-interface {v0, v2}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 202
    sget-object v2, Lcom/opongo/blogapp/api/BlogAPI;->httpConnect:Lcom/opongo/blogapp/api/HTTPConnect;

    .line 203
    iget-object v3, p0, Lcom/opongo/blogapp/api/BlogAPI;->context:Landroid/content/Context;

    const/4 v4, 0x0

    const/4 v5, 0x0

    .line 202
    invoke-virtual {v2, v0, v3, v4, v5}, Lcom/opongo/blogapp/api/HTTPConnect;->getJSONObjectWithPost(Ljava/util/List;Landroid/content/Context;Z[Landroid/graphics/Bitmap;)Lorg/json/JSONObject;

    move-result-object v1

    .line 205
    .local v1, result:Lorg/json/JSONObject;
    if-nez v1, :cond_0

    .line 206
    sget-boolean v2, Lcom/opongo/blogapp/api/BlogAPI;->DEBUG:Z

    if-eqz v2, :cond_0

    .line 207
    sget-object v2, Lcom/opongo/blogapp/api/BlogAPI;->TAG:Ljava/lang/String;

    const-string v3, "Received a null object"

    invoke-static {v2, v3}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I

    .line 210
    :cond_0
    return-object v1
.end method

.method public registerUser(Ljava/lang/String;)I
    .locals 8
    .parameter "deviceToken"

    .prologue
    .line 154
    new-instance v1, Ljava/util/ArrayList;

    const/4 v4, 0x2

    invoke-direct {v1, v4}, Ljava/util/ArrayList;-><init>(I)V

    .line 155
    .local v1, nameValuePairs:Ljava/util/List;,"Ljava/util/List<Lorg/apache/http/NameValuePair;>;"
    new-instance v4, Lorg/apache/http/message/BasicNameValuePair;

    const-string v5, "do"

    const-string v6, "user"

    invoke-direct {v4, v5, v6}, Lorg/apache/http/message/BasicNameValuePair;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    invoke-interface {v1, v4}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 157
    const-string v4, ""

    invoke-virtual {p1, v4}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v4

    if-nez v4, :cond_0

    .line 158
    new-instance v4, Lorg/apache/http/message/BasicNameValuePair;

    const-string v5, "deviceToken"

    .line 159
    invoke-direct {v4, v5, p1}, Lorg/apache/http/message/BasicNameValuePair;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    .line 158
    invoke-interface {v1, v4}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 161
    :cond_0
    new-instance v4, Lorg/apache/http/message/BasicNameValuePair;

    const-string v5, "device"

    sget-object v6, Landroid/os/Build;->DEVICE:Ljava/lang/String;

    invoke-direct {v4, v5, v6}, Lorg/apache/http/message/BasicNameValuePair;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    invoke-interface {v1, v4}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 162
    new-instance v4, Lorg/apache/http/message/BasicNameValuePair;

    const-string v5, "systemVersion"

    .line 163
    sget v6, Landroid/os/Build$VERSION;->SDK_INT:I

    invoke-static {v6}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v6

    invoke-direct {v4, v5, v6}, Lorg/apache/http/message/BasicNameValuePair;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    .line 162
    invoke-interface {v1, v4}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 165
    sget-object v4, Lcom/opongo/blogapp/api/BlogAPI;->httpConnect:Lcom/opongo/blogapp/api/HTTPConnect;

    .line 166
    iget-object v5, p0, Lcom/opongo/blogapp/api/BlogAPI;->context:Landroid/content/Context;

    const-string v6, ""

    invoke-virtual {p1, v6}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v6

    const/4 v7, 0x0

    .line 165
    invoke-virtual {v4, v1, v5, v6, v7}, Lcom/opongo/blogapp/api/HTTPConnect;->getJSONObjectWithPost(Ljava/util/List;Landroid/content/Context;Z[Landroid/graphics/Bitmap;)Lorg/json/JSONObject;

    move-result-object v2

    .line 168
    .local v2, result:Lorg/json/JSONObject;
    if-eqz v2, :cond_2

    .line 170
    :try_start_0
    const-string v4, "user_id"

    invoke-virtual {v2, v4}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v4

    invoke-static {v4}, Ljava/lang/Integer;->valueOf(Ljava/lang/String;)Ljava/lang/Integer;

    move-result-object v4

    invoke-virtual {v4}, Ljava/lang/Integer;->intValue()I

    move-result v3

    .line 171
    .local v3, user_id:I
    iget-object v4, p0, Lcom/opongo/blogapp/api/BlogAPI;->editor:Landroid/content/SharedPreferences$Editor;

    const-string v5, "user_id"

    invoke-interface {v4, v5, v3}, Landroid/content/SharedPreferences$Editor;->putInt(Ljava/lang/String;I)Landroid/content/SharedPreferences$Editor;

    .line 172
    iget-object v4, p0, Lcom/opongo/blogapp/api/BlogAPI;->editor:Landroid/content/SharedPreferences$Editor;

    invoke-interface {v4}, Landroid/content/SharedPreferences$Editor;->commit()Z
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 173
    if-eqz v3, :cond_1

    .line 184
    .end local v3           #user_id:I
    :goto_0
    return v3

    .line 176
    :catch_0
    move-exception v0

    .line 177
    .local v0, e:Ljava/lang/Exception;
    sget-boolean v4, Lcom/opongo/blogapp/api/BlogAPI;->DEBUG:Z

    if-eqz v4, :cond_1

    .line 178
    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V

    .line 184
    .end local v0           #e:Ljava/lang/Exception;
    :cond_1
    :goto_1
    const/4 v3, 0x0

    goto :goto_0

    .line 181
    :cond_2
    sget-boolean v4, Lcom/opongo/blogapp/api/BlogAPI;->DEBUG:Z

    if-eqz v4, :cond_1

    .line 182
    sget-object v4, Lcom/opongo/blogapp/api/BlogAPI;->TAG:Ljava/lang/String;

    const-string v5, "Received a null object"

    invoke-static {v4, v5}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I

    goto :goto_1
.end method

.method public saveCategoriesOnServer(Ljava/lang/String;)Lorg/json/JSONObject;
    .locals 6
    .parameter "category_string"

    .prologue
    .line 287
    new-instance v0, Ljava/util/ArrayList;

    const/4 v2, 0x2

    invoke-direct {v0, v2}, Ljava/util/ArrayList;-><init>(I)V

    .line 288
    .local v0, nameValuePairs:Ljava/util/List;,"Ljava/util/List<Lorg/apache/http/NameValuePair;>;"
    new-instance v2, Lorg/apache/http/message/BasicNameValuePair;

    const-string v3, "do"

    const-string v4, "categories"

    invoke-direct {v2, v3, v4}, Lorg/apache/http/message/BasicNameValuePair;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    invoke-interface {v0, v2}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 290
    new-instance v2, Lorg/apache/http/message/BasicNameValuePair;

    const-string v3, "categories"

    invoke-direct {v2, v3, p1}, Lorg/apache/http/message/BasicNameValuePair;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    invoke-interface {v0, v2}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 291
    new-instance v2, Lorg/apache/http/message/BasicNameValuePair;

    const-string v3, "true"

    const-string v4, "catUpdate"

    invoke-direct {v2, v3, v4}, Lorg/apache/http/message/BasicNameValuePair;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    invoke-interface {v0, v2}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 293
    sget-object v2, Lcom/opongo/blogapp/api/BlogAPI;->httpConnect:Lcom/opongo/blogapp/api/HTTPConnect;

    .line 294
    iget-object v3, p0, Lcom/opongo/blogapp/api/BlogAPI;->context:Landroid/content/Context;

    const/4 v4, 0x0

    const/4 v5, 0x0

    .line 293
    invoke-virtual {v2, v0, v3, v4, v5}, Lcom/opongo/blogapp/api/HTTPConnect;->getJSONObjectWithPost(Ljava/util/List;Landroid/content/Context;Z[Landroid/graphics/Bitmap;)Lorg/json/JSONObject;

    move-result-object v1

    .line 296
    .local v1, result:Lorg/json/JSONObject;
    if-nez v1, :cond_0

    .line 297
    sget-boolean v2, Lcom/opongo/blogapp/api/BlogAPI;->DEBUG:Z

    if-eqz v2, :cond_0

    .line 298
    sget-object v2, Lcom/opongo/blogapp/api/BlogAPI;->TAG:Ljava/lang/String;

    const-string v3, "Received a null object"

    invoke-static {v2, v3}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I

    .line 301
    :cond_0
    return-object v1
.end method

.method public sendSpicyDealsDeal(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Landroid/graphics/Bitmap;)Lorg/json/JSONObject;
    .locals 6
    .parameter "spicydeals_name"
    .parameter "spicydeals_title"
    .parameter "spicydeals_content"
    .parameter "spicydeals_price"
    .parameter "spicydeals_link"
    .parameter "spicydeals_date"
    .parameter "spicydeals_code"
    .parameter "spicydeals_discount"
    .parameter "spicydeals_place"
    .parameter "spicydeals_cat"
    .parameter "spicydeals_type"
    .parameter "captureBmp"

    .prologue
    .line 390
    new-instance v1, Ljava/util/ArrayList;

    const/4 v3, 0x2

    invoke-direct {v1, v3}, Ljava/util/ArrayList;-><init>(I)V

    .line 391
    .local v1, nameValuePairs:Ljava/util/List;,"Ljava/util/List<Lorg/apache/http/NameValuePair;>;"
    new-instance v3, Lorg/apache/http/message/BasicNameValuePair;

    const-string v4, "do"

    const-string v5, "addSpicyDeal"

    invoke-direct {v3, v4, v5}, Lorg/apache/http/message/BasicNameValuePair;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    invoke-interface {v1, v3}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 393
    new-instance v3, Lorg/apache/http/message/BasicNameValuePair;

    const-string v4, "type"

    .line 394
    invoke-static/range {p11 .. p11}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v5

    invoke-direct {v3, v4, v5}, Lorg/apache/http/message/BasicNameValuePair;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    .line 393
    invoke-interface {v1, v3}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 395
    new-instance v3, Lorg/apache/http/message/BasicNameValuePair;

    const-string v4, "title"

    .line 396
    invoke-static {p2}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v5

    invoke-direct {v3, v4, v5}, Lorg/apache/http/message/BasicNameValuePair;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    .line 395
    invoke-interface {v1, v3}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 397
    new-instance v3, Lorg/apache/http/message/BasicNameValuePair;

    const-string v4, "price"

    .line 398
    invoke-static {p4}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v5

    invoke-direct {v3, v4, v5}, Lorg/apache/http/message/BasicNameValuePair;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    .line 397
    invoke-interface {v1, v3}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 399
    new-instance v3, Lorg/apache/http/message/BasicNameValuePair;

    const-string v4, "link"

    .line 400
    invoke-static {p5}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v5

    invoke-direct {v3, v4, v5}, Lorg/apache/http/message/BasicNameValuePair;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    .line 399
    invoke-interface {v1, v3}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 401
    new-instance v3, Lorg/apache/http/message/BasicNameValuePair;

    const-string v4, "until"

    .line 402
    invoke-static {p6}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v5

    invoke-direct {v3, v4, v5}, Lorg/apache/http/message/BasicNameValuePair;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    .line 401
    invoke-interface {v1, v3}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 403
    new-instance v3, Lorg/apache/http/message/BasicNameValuePair;

    const-string v4, "description"

    .line 404
    invoke-static {p3}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v5

    invoke-direct {v3, v4, v5}, Lorg/apache/http/message/BasicNameValuePair;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    .line 403
    invoke-interface {v1, v3}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 405
    new-instance v3, Lorg/apache/http/message/BasicNameValuePair;

    const-string v4, "cat"

    .line 406
    invoke-static/range {p10 .. p10}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v5

    invoke-direct {v3, v4, v5}, Lorg/apache/http/message/BasicNameValuePair;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    .line 405
    invoke-interface {v1, v3}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 407
    new-instance v3, Lorg/apache/http/message/BasicNameValuePair;

    const-string v4, "user_name"

    .line 408
    invoke-static {p1}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v5

    invoke-direct {v3, v4, v5}, Lorg/apache/http/message/BasicNameValuePair;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    .line 407
    invoke-interface {v1, v3}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 409
    new-instance v3, Lorg/apache/http/message/BasicNameValuePair;

    const-string v4, "code"

    .line 410
    invoke-static {p7}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v5

    invoke-direct {v3, v4, v5}, Lorg/apache/http/message/BasicNameValuePair;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    .line 409
    invoke-interface {v1, v3}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 411
    new-instance v3, Lorg/apache/http/message/BasicNameValuePair;

    const-string v4, "discount"

    .line 412
    invoke-static {p8}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v5

    invoke-direct {v3, v4, v5}, Lorg/apache/http/message/BasicNameValuePair;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    .line 411
    invoke-interface {v1, v3}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 413
    new-instance v3, Lorg/apache/http/message/BasicNameValuePair;

    const-string v4, "formatted_address"

    .line 414
    invoke-static {p9}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v5

    invoke-direct {v3, v4, v5}, Lorg/apache/http/message/BasicNameValuePair;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    .line 413
    invoke-interface {v1, v3}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 416
    const/4 v3, 0x1

    new-array v0, v3, [Landroid/graphics/Bitmap;

    const/4 v3, 0x0

    aput-object p12, v0, v3

    .line 418
    .local v0, images:[Landroid/graphics/Bitmap;
    sget-object v3, Lcom/opongo/blogapp/api/BlogAPI;->httpConnect:Lcom/opongo/blogapp/api/HTTPConnect;

    .line 419
    iget-object v4, p0, Lcom/opongo/blogapp/api/BlogAPI;->context:Landroid/content/Context;

    const/4 v5, 0x0

    if-eqz p12, :cond_1

    .line 418
    .end local v0           #images:[Landroid/graphics/Bitmap;
    :goto_0
    invoke-virtual {v3, v1, v4, v5, v0}, Lcom/opongo/blogapp/api/HTTPConnect;->getJSONObjectWithPost(Ljava/util/List;Landroid/content/Context;Z[Landroid/graphics/Bitmap;)Lorg/json/JSONObject;

    move-result-object v2

    .line 421
    .local v2, result:Lorg/json/JSONObject;
    if-nez v2, :cond_0

    .line 422
    sget-boolean v3, Lcom/opongo/blogapp/api/BlogAPI;->DEBUG:Z

    if-eqz v3, :cond_0

    .line 423
    sget-object v3, Lcom/opongo/blogapp/api/BlogAPI;->TAG:Ljava/lang/String;

    const-string v4, "Received a null object"

    invoke-static {v3, v4}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I

    .line 426
    :cond_0
    return-object v2

    .line 419
    .end local v2           #result:Lorg/json/JSONObject;
    .restart local v0       #images:[Landroid/graphics/Bitmap;
    :cond_1
    const/4 v0, 0x0

    goto :goto_0
.end method

.method public sendSpicyDealsVote(II)Lorg/json/JSONObject;
    .locals 6
    .parameter "post_id"
    .parameter "rate"

    .prologue
    .line 367
    new-instance v0, Ljava/util/ArrayList;

    const/4 v2, 0x2

    invoke-direct {v0, v2}, Ljava/util/ArrayList;-><init>(I)V

    .line 368
    .local v0, nameValuePairs:Ljava/util/List;,"Ljava/util/List<Lorg/apache/http/NameValuePair;>;"
    new-instance v2, Lorg/apache/http/message/BasicNameValuePair;

    const-string v3, "do"

    const-string v4, "voteDeal"

    invoke-direct {v2, v3, v4}, Lorg/apache/http/message/BasicNameValuePair;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    invoke-interface {v0, v2}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 369
    new-instance v2, Lorg/apache/http/message/BasicNameValuePair;

    const-string v3, "post_ID"

    .line 370
    invoke-static {p1}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v4

    invoke-direct {v2, v3, v4}, Lorg/apache/http/message/BasicNameValuePair;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    .line 369
    invoke-interface {v0, v2}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 372
    new-instance v2, Lorg/apache/http/message/BasicNameValuePair;

    const-string v3, "rate"

    invoke-static {p2}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v4

    invoke-direct {v2, v3, v4}, Lorg/apache/http/message/BasicNameValuePair;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    invoke-interface {v0, v2}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 374
    sget-object v2, Lcom/opongo/blogapp/api/BlogAPI;->httpConnect:Lcom/opongo/blogapp/api/HTTPConnect;

    .line 375
    iget-object v3, p0, Lcom/opongo/blogapp/api/BlogAPI;->context:Landroid/content/Context;

    const/4 v4, 0x0

    const/4 v5, 0x0

    .line 374
    invoke-virtual {v2, v0, v3, v4, v5}, Lcom/opongo/blogapp/api/HTTPConnect;->getJSONObjectWithPost(Ljava/util/List;Landroid/content/Context;Z[Landroid/graphics/Bitmap;)Lorg/json/JSONObject;

    move-result-object v1

    .line 377
    .local v1, result:Lorg/json/JSONObject;
    if-nez v1, :cond_0

    .line 378
    sget-boolean v2, Lcom/opongo/blogapp/api/BlogAPI;->DEBUG:Z

    if-eqz v2, :cond_0

    .line 379
    sget-object v2, Lcom/opongo/blogapp/api/BlogAPI;->TAG:Ljava/lang/String;

    const-string v3, "Received a null object"

    invoke-static {v2, v3}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I

    .line 382
    :cond_0
    return-object v1
.end method

.method public setNighttime(Ljava/lang/String;Ljava/lang/String;ZLjava/lang/String;I)Lorg/json/JSONObject;
    .locals 6
    .parameter "nighttime_from"
    .parameter "nighttime_to"
    .parameter "pushSwitch"
    .parameter "sound"
    .parameter "spicyDealsTemp"

    .prologue
    const/4 v5, 0x0

    .line 251
    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0, v5}, Ljava/util/ArrayList;-><init>(I)V

    .line 253
    .local v0, nameValuePairs:Ljava/util/List;,"Ljava/util/List<Lorg/apache/http/NameValuePair;>;"
    new-instance v2, Lorg/apache/http/message/BasicNameValuePair;

    const-string v3, "do"

    const-string v4, "setNighttime"

    invoke-direct {v2, v3, v4}, Lorg/apache/http/message/BasicNameValuePair;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    invoke-interface {v0, v2}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 254
    new-instance v2, Lorg/apache/http/message/BasicNameValuePair;

    const-string v3, "nighttime_from"

    .line 255
    invoke-direct {v2, v3, p1}, Lorg/apache/http/message/BasicNameValuePair;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    .line 254
    invoke-interface {v0, v2}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 257
    new-instance v2, Lorg/apache/http/message/BasicNameValuePair;

    const-string v3, "nighttime_to"

    invoke-direct {v2, v3, p2}, Lorg/apache/http/message/BasicNameValuePair;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    invoke-interface {v0, v2}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 258
    new-instance v2, Lorg/apache/http/message/BasicNameValuePair;

    const-string v3, "sound"

    invoke-direct {v2, v3, p4}, Lorg/apache/http/message/BasicNameValuePair;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    invoke-interface {v0, v2}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 259
    new-instance v2, Lorg/apache/http/message/BasicNameValuePair;

    const-string v3, "pushSwitch"

    .line 260
    invoke-static {p3}, Ljava/lang/String;->valueOf(Z)Ljava/lang/String;

    move-result-object v4

    invoke-direct {v2, v3, v4}, Lorg/apache/http/message/BasicNameValuePair;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    .line 259
    invoke-interface {v0, v2}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 262
    new-instance v2, Lorg/apache/http/message/BasicNameValuePair;

    const-string v3, "spicy_degree"

    .line 263
    invoke-static {p5}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v4

    invoke-direct {v2, v3, v4}, Lorg/apache/http/message/BasicNameValuePair;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    .line 262
    invoke-interface {v0, v2}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 265
    sget-object v2, Lcom/opongo/blogapp/api/BlogAPI;->httpConnect:Lcom/opongo/blogapp/api/HTTPConnect;

    .line 266
    iget-object v3, p0, Lcom/opongo/blogapp/api/BlogAPI;->context:Landroid/content/Context;

    const/4 v4, 0x0

    .line 265
    invoke-virtual {v2, v0, v3, v5, v4}, Lcom/opongo/blogapp/api/HTTPConnect;->getJSONObjectWithPost(Ljava/util/List;Landroid/content/Context;Z[Landroid/graphics/Bitmap;)Lorg/json/JSONObject;

    move-result-object v1

    .line 268
    .local v1, result:Lorg/json/JSONObject;
    return-object v1
.end method

.method public showPosts(IIILjava/lang/String;ILjava/lang/String;)Lorg/json/JSONObject;
    .locals 11
    .parameter "blogType"
    .parameter "page"
    .parameter "posts_per_page"
    .parameter "searchString"
    .parameter "cat_id"
    .parameter "categories"

    .prologue
    .line 65
    new-instance v4, Ljava/util/ArrayList;

    const/4 v7, 0x2

    invoke-direct {v4, v7}, Ljava/util/ArrayList;-><init>(I)V

    .line 67
    .local v4, nameValuePairs:Ljava/util/List;,"Ljava/util/List<Lorg/apache/http/NameValuePair;>;"
    new-instance v7, Lorg/apache/http/message/BasicNameValuePair;

    const-string v8, "blogType"

    .line 68
    invoke-static {p1}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v9

    invoke-direct {v7, v8, v9}, Lorg/apache/http/message/BasicNameValuePair;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    .line 67
    invoke-interface {v4, v7}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 70
    new-instance v7, Lorg/apache/http/message/BasicNameValuePair;

    const-string v8, "do"

    const-string v9, "showposts"

    invoke-direct {v7, v8, v9}, Lorg/apache/http/message/BasicNameValuePair;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    invoke-interface {v4, v7}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 72
    new-instance v7, Lorg/apache/http/message/BasicNameValuePair;

    const-string v8, "paged"

    invoke-static {p2}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v9

    invoke-direct {v7, v8, v9}, Lorg/apache/http/message/BasicNameValuePair;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    invoke-interface {v4, v7}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 73
    new-instance v7, Lorg/apache/http/message/BasicNameValuePair;

    const-string v8, "showposts"

    .line 74
    invoke-static {p3}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v9

    invoke-direct {v7, v8, v9}, Lorg/apache/http/message/BasicNameValuePair;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    .line 73
    invoke-interface {v4, v7}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 77
    iget-object v7, p0, Lcom/opongo/blogapp/api/BlogAPI;->settings:Landroid/content/SharedPreferences;

    .line 78
    const-string v8, "categoriesLastModifiedDate"

    const-string v9, "null"

    .line 77
    invoke-interface {v7, v8, v9}, Landroid/content/SharedPreferences;->getString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    .line 80
    .local v2, categoriesLastModifiedDate:Ljava/lang/String;
    if-eqz p6, :cond_0

    .line 82
    new-instance v7, Lorg/apache/http/message/BasicNameValuePair;

    const-string v8, "categories"

    move-object/from16 v0, p6

    invoke-direct {v7, v8, v0}, Lorg/apache/http/message/BasicNameValuePair;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    invoke-interface {v4, v7}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 84
    :cond_0
    if-eqz p4, :cond_1

    .line 85
    const-string v7, ""

    invoke-virtual {p4, v7}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v7

    if-nez v7, :cond_1

    .line 86
    new-instance v7, Lorg/apache/http/message/BasicNameValuePair;

    const-string v8, "s"

    invoke-direct {v7, v8, p4}, Lorg/apache/http/message/BasicNameValuePair;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    invoke-interface {v4, v7}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 88
    :cond_1
    const/4 v7, -0x1

    move/from16 v0, p5

    if-eq v0, v7, :cond_2

    .line 89
    new-instance v7, Lorg/apache/http/message/BasicNameValuePair;

    const-string v8, "cat_id"

    .line 90
    invoke-static/range {p5 .. p5}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v9

    invoke-direct {v7, v8, v9}, Lorg/apache/http/message/BasicNameValuePair;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    .line 89
    invoke-interface {v4, v7}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 92
    :cond_2
    sget-boolean v7, Lcom/opongo/blogapp/api/BlogAPI;->DEBUG:Z

    if-eqz v7, :cond_3

    .line 93
    sget-object v7, Lcom/opongo/blogapp/api/BlogAPI;->TAG:Ljava/lang/String;

    new-instance v8, Ljava/lang/StringBuilder;

    const-string v9, "categoriesLastModifiedDate: "

    invoke-direct {v8, v9}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    .line 94
    invoke-virtual {v8, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v8

    invoke-virtual {v8}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v8

    .line 93
    invoke-static {v7, v8}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 96
    :cond_3
    new-instance v7, Lorg/apache/http/message/BasicNameValuePair;

    const-string v8, "categoriesLastModifiedDate"

    .line 97
    invoke-direct {v7, v8, v2}, Lorg/apache/http/message/BasicNameValuePair;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    .line 96
    invoke-interface {v4, v7}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 100
    iget-object v7, p0, Lcom/opongo/blogapp/api/BlogAPI;->settings:Landroid/content/SharedPreferences;

    const-string v8, "optionsLastUpdate"

    .line 101
    const-string v9, "null"

    .line 100
    invoke-interface {v7, v8, v9}, Landroid/content/SharedPreferences;->getString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v5

    .line 102
    .local v5, optionsLastUpdate:Ljava/lang/String;
    new-instance v7, Lorg/apache/http/message/BasicNameValuePair;

    const-string v8, "optionsLastUpdate"

    .line 103
    invoke-direct {v7, v8, v5}, Lorg/apache/http/message/BasicNameValuePair;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    .line 102
    invoke-interface {v4, v7}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 105
    sget-object v7, Lcom/opongo/blogapp/api/BlogAPI;->httpConnect:Lcom/opongo/blogapp/api/HTTPConnect;

    .line 106
    iget-object v8, p0, Lcom/opongo/blogapp/api/BlogAPI;->context:Landroid/content/Context;

    const/4 v9, 0x0

    const/4 v10, 0x0

    .line 105
    invoke-virtual {v7, v4, v8, v9, v10}, Lcom/opongo/blogapp/api/HTTPConnect;->getJSONObjectWithPost(Ljava/util/List;Landroid/content/Context;Z[Landroid/graphics/Bitmap;)Lorg/json/JSONObject;

    move-result-object v6

    .line 108
    .local v6, result:Lorg/json/JSONObject;
    if-eqz v6, :cond_7

    .line 112
    :try_start_0
    const-string v7, "categoriesLastModifiedDate"

    invoke-virtual {v6, v7}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    .line 113
    iget-object v7, p0, Lcom/opongo/blogapp/api/BlogAPI;->editor:Landroid/content/SharedPreferences$Editor;

    const-string v8, "categoriesLastModifiedDate"

    invoke-interface {v7, v8, v2}, Landroid/content/SharedPreferences$Editor;->putString(Ljava/lang/String;Ljava/lang/String;)Landroid/content/SharedPreferences$Editor;

    .line 116
    const-string v7, "optionsLastUpdate"

    invoke-virtual {v6, v7}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v5

    .line 124
    iget-object v7, p0, Lcom/opongo/blogapp/api/BlogAPI;->editor:Landroid/content/SharedPreferences$Editor;

    const-string v8, "optionsLastUpdate"

    invoke-interface {v7, v8, v5}, Landroid/content/SharedPreferences$Editor;->putString(Ljava/lang/String;Ljava/lang/String;)Landroid/content/SharedPreferences$Editor;

    .line 127
    const-string v7, "blog_details"

    invoke-virtual {v6, v7}, Lorg/json/JSONObject;->optString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    .line 128
    .local v1, bDetails:Ljava/lang/String;
    sget-boolean v7, Lcom/opongo/blogapp/api/BlogAPI;->DEBUG:Z

    if-eqz v7, :cond_4

    .line 129
    sget-object v7, Lcom/opongo/blogapp/api/BlogAPI;->TAG:Ljava/lang/String;

    new-instance v8, Ljava/lang/StringBuilder;

    const-string v9, "BlogDetails: "

    invoke-direct {v8, v9}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v8, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v8

    invoke-virtual {v8}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v8

    invoke-static {v7, v8}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I

    .line 131
    :cond_4
    const-string v7, ""

    invoke-virtual {v1, v7}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v7

    if-nez v7, :cond_5

    .line 132
    iget-object v7, p0, Lcom/opongo/blogapp/api/BlogAPI;->editor:Landroid/content/SharedPreferences$Editor;

    const-string v8, "blog_details"

    invoke-interface {v7, v8, v1}, Landroid/content/SharedPreferences$Editor;->putString(Ljava/lang/String;Ljava/lang/String;)Landroid/content/SharedPreferences$Editor;

    .line 134
    :cond_5
    iget-object v7, p0, Lcom/opongo/blogapp/api/BlogAPI;->editor:Landroid/content/SharedPreferences$Editor;

    invoke-interface {v7}, Landroid/content/SharedPreferences$Editor;->commit()Z
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 145
    .end local v1           #bDetails:Ljava/lang/String;
    :cond_6
    :goto_0
    return-object v6

    .line 136
    :catch_0
    move-exception v3

    .line 137
    .local v3, e:Ljava/lang/Exception;
    sget-boolean v7, Lcom/opongo/blogapp/api/BlogAPI;->DEBUG:Z

    if-eqz v7, :cond_6

    .line 138
    invoke-virtual {v3}, Ljava/lang/Exception;->printStackTrace()V

    goto :goto_0

    .line 141
    .end local v3           #e:Ljava/lang/Exception;
    :cond_7
    sget-boolean v7, Lcom/opongo/blogapp/api/BlogAPI;->DEBUG:Z

    if-eqz v7, :cond_6

    .line 142
    sget-object v7, Lcom/opongo/blogapp/api/BlogAPI;->TAG:Ljava/lang/String;

    const-string v8, "Received a null object"

    invoke-static {v7, v8}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I

    goto :goto_0
.end method

.method public showSpicyDeals(IIILjava/lang/String;Ljava/lang/String;Ljava/lang/String;)Lorg/json/JSONObject;
    .locals 7
    .parameter "blogType"
    .parameter "page"
    .parameter "posts_per_page"
    .parameter "order"
    .parameter "range"
    .parameter "searchString"

    .prologue
    .line 319
    new-instance v1, Ljava/util/ArrayList;

    const/4 v3, 0x2

    invoke-direct {v1, v3}, Ljava/util/ArrayList;-><init>(I)V

    .line 321
    .local v1, nameValuePairs:Ljava/util/List;,"Ljava/util/List<Lorg/apache/http/NameValuePair;>;"
    new-instance v3, Lorg/apache/http/message/BasicNameValuePair;

    const-string v4, "blogType"

    .line 322
    invoke-static {p1}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v5

    invoke-direct {v3, v4, v5}, Lorg/apache/http/message/BasicNameValuePair;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    .line 321
    invoke-interface {v1, v3}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 324
    new-instance v3, Lorg/apache/http/message/BasicNameValuePair;

    const-string v4, "do"

    const-string v5, "showposts"

    invoke-direct {v3, v4, v5}, Lorg/apache/http/message/BasicNameValuePair;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    invoke-interface {v1, v3}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 326
    new-instance v3, Lorg/apache/http/message/BasicNameValuePair;

    const-string v4, "paged"

    invoke-static {p2}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v5

    invoke-direct {v3, v4, v5}, Lorg/apache/http/message/BasicNameValuePair;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    invoke-interface {v1, v3}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 328
    new-instance v3, Lorg/apache/http/message/BasicNameValuePair;

    const-string v4, "showposts"

    .line 329
    invoke-static {p3}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v5

    invoke-direct {v3, v4, v5}, Lorg/apache/http/message/BasicNameValuePair;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    .line 328
    invoke-interface {v1, v3}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 331
    new-instance v3, Lorg/apache/http/message/BasicNameValuePair;

    const-string v4, "order"

    invoke-direct {v3, v4, p4}, Lorg/apache/http/message/BasicNameValuePair;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    invoke-interface {v1, v3}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 333
    new-instance v3, Lorg/apache/http/message/BasicNameValuePair;

    const-string v4, "range"

    invoke-direct {v3, v4, p5}, Lorg/apache/http/message/BasicNameValuePair;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    invoke-interface {v1, v3}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 335
    if-eqz p6, :cond_0

    .line 336
    new-instance v3, Lorg/apache/http/message/BasicNameValuePair;

    const-string v4, "s"

    invoke-direct {v3, v4, p6}, Lorg/apache/http/message/BasicNameValuePair;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    invoke-interface {v1, v3}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 339
    :cond_0
    new-instance v3, Lorg/apache/http/message/BasicNameValuePair;

    const-string v4, "categoriesLastModifiedDate"

    .line 340
    const-string v5, "null"

    invoke-direct {v3, v4, v5}, Lorg/apache/http/message/BasicNameValuePair;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    .line 339
    invoke-interface {v1, v3}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 341
    new-instance v3, Lorg/apache/http/message/BasicNameValuePair;

    const-string v4, "optionsLastUpdate"

    const-string v5, "null"

    invoke-direct {v3, v4, v5}, Lorg/apache/http/message/BasicNameValuePair;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    invoke-interface {v1, v3}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 343
    new-instance v3, Lorg/apache/http/message/BasicNameValuePair;

    const-string v4, "tag_filter"

    const-string v5, "1"

    invoke-direct {v3, v4, v5}, Lorg/apache/http/message/BasicNameValuePair;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    invoke-interface {v1, v3}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 345
    sget-object v3, Lcom/opongo/blogapp/api/BlogAPI;->httpConnect:Lcom/opongo/blogapp/api/HTTPConnect;

    .line 346
    iget-object v4, p0, Lcom/opongo/blogapp/api/BlogAPI;->context:Landroid/content/Context;

    const/4 v5, 0x0

    const/4 v6, 0x0

    .line 345
    invoke-virtual {v3, v1, v4, v5, v6}, Lcom/opongo/blogapp/api/HTTPConnect;->getJSONObjectWithPost(Ljava/util/List;Landroid/content/Context;Z[Landroid/graphics/Bitmap;)Lorg/json/JSONObject;

    move-result-object v2

    .line 348
    .local v2, result:Lorg/json/JSONObject;
    if-eqz v2, :cond_2

    .line 350
    :try_start_0
    sget-boolean v3, Lcom/opongo/blogapp/api/BlogAPI;->DEBUG:Z

    if-eqz v3, :cond_1

    .line 351
    sget-object v3, Lcom/opongo/blogapp/api/BlogAPI;->TAG:Ljava/lang/String;

    invoke-virtual {v2}, Lorg/json/JSONObject;->toString()Ljava/lang/String;

    move-result-object v4

    invoke-static {v3, v4}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 362
    :cond_1
    :goto_0
    return-object v2

    .line 353
    :catch_0
    move-exception v0

    .line 354
    .local v0, e:Ljava/lang/Exception;
    sget-boolean v3, Lcom/opongo/blogapp/api/BlogAPI;->DEBUG:Z

    if-eqz v3, :cond_1

    .line 355
    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V

    goto :goto_0

    .line 358
    .end local v0           #e:Ljava/lang/Exception;
    :cond_2
    sget-boolean v3, Lcom/opongo/blogapp/api/BlogAPI;->DEBUG:Z

    if-eqz v3, :cond_1

    .line 359
    sget-object v3, Lcom/opongo/blogapp/api/BlogAPI;->TAG:Ljava/lang/String;

    const-string v4, "Received a null object"

    invoke-static {v3, v4}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I

    goto :goto_0
.end method
